package com.orangelife.mobile.housepurchasing.biz;

import com.curry.android.http.VolleyHttpUtil;
import com.curry.android.util.JSONHelper;
import com.orangelife.mobile.constants.Constant;

import org.json.JSONObject;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by HeYuCan on 2016/5/26.
 */
public class ToEntrustHttpBiz {
/*获取小区的委托热线*/
    private static final String URL_COMM_HOTLINE = Constant.URL_REALESTATE_COMM_HOTLINE;
    /*post"我要委托"的请求*/
    private static final String URL_POST_ENTRUST=Constant.URL_REALESTATE_TO_ENTRUST;
    /**/

    /**
     * 获取小区的委托热线
     */
    public static void requestCommHotLine(VolleyHttpUtil.ResponseCallBack callBack) {
        HashMap<String, String> map = new HashMap<>();
        VolleyHttpUtil.getInstance().getWithCallback(URL_COMM_HOTLINE, map, callBack);

    }

    /**
     * post"我要委托"的请求
     */
    public static void postEntrust(String commID,VolleyHttpUtil.ResponseCallBack callBack){
        HashMap<String,Object> map=new HashMap<>();
        map.put("commID",commID);
        VolleyHttpUtil.getInstance().postWithCallback(URL_POST_ENTRUST, map, callBack);
    }

    public static Map<String,Object> getCommHotline(JSONObject response){
        Map<String,Object> map=new HashMap<>();
        map= (Map<String,Object>)JSONHelper.jsonToMap(String.valueOf(response)).get("entity");
        return map;
    }

    public static Map<String,Object> getEntrustFeedback(JSONObject response){
        Map<String,Object> map=new HashMap<>();
        map=(Map<String,Object>)JSONHelper.jsonToMap(String.valueOf(response));
        return map;
    }

}
